]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
dash: Fix drag placeholder position in RTL
authorFlorian Müllner <fmuellner@gnome.org>
Sat, 26 Feb 2022 17:35:47 +0000 (18:35 +0100)
committerMarge Bot <marge-bot@gnome.org>
Thu, 3 Mar 2022 20:19:19 +0000 (20:19 +0000)
The position corresponds to a child index, which means it must
be mirrored when starting to count from the right.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/4574

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2219>

js/ui/dash.js

index e5f81fca74009fcfd3c3b4e74311133273e139e1..24d3a8907ea5fb626e9cc892e8167c52697cd341 100644 (file)
@@ -883,10 +883,12 @@ var Dash = GObject.registerClass({
         }
 
         let pos;
-        if (!this._emptyDropTarget)
-            pos = Math.floor(x * numChildren / boxWidth);
+        if (this._emptyDropTarget)
+            pos = 0; // always insert at the start when dash is empty
+        else if (this.text_direction === Clutter.TextDirection.RTL)
+            pos = numChildren - Math.floor(x * numChildren / boxWidth);
         else
-            pos = 0; // always insert at the top when dash is empty
+            pos = Math.floor(x * numChildren / boxWidth);
 
         // Put the placeholder after the last favorite if we are not
         // in the favorites zone